#!/bin/bash

# Build script for CPU Scheduler GUI

BUILD_TYPE=${1:-Release}

echo "Building CPU Scheduler GUI ($BUILD_TYPE)..."

# Create build directory
mkdir -p build
cd build

# Configure project with CMake
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE

# Build project
make -j$(nproc)

if [ $? -eq 0 ]; then
    echo "Build successful!"
    echo "Executable located at: build/cpu-scheduler-gui"
else
    echo "Build failed!"
    exit 1
fi